package kata09.order;

import kata09.customer.BuyGoods;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

//订单
@Data
public class Order {

    //购买商品明细
    private List<BuyGoods>  buyGoods;

    //获取折后总价格
    public BigDecimal getDiscountCountPrice(){
        BigDecimal discountCountPrice = BigDecimal.ZERO;
        for (BuyGoods goods : buyGoods) {
            discountCountPrice = discountCountPrice.add(goods.getGoodsCountDiscountPrice());
        }
        return discountCountPrice;
    }
}
